<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="/public :: #public_head"></head>
<body>
<header th:replace="/public :: #public_header"></header>
<section th:replace="/public :: #public_time"></section>
<!---->
<section class="publicMian ">
    <div class="left" th:replace="/public :: #public_left"></div>
    <div class="right">
        <div class="location">
            <strong>你现在所在的位置是:</strong>
            <span>订单管理</span>
        </div>
        <div class="search">
            <form id="searchForm" th:action="@{/bills}" th:method="get">
                <span>商品名称：</span>
                <input th:value="${billName}" name="billName" type="text" placeholder="输入商品名称"/>
                <span>供应商：</span>
                <select name="pid">
                    <option value="">--请选择--</option>
                    <option th:each="provider:${providers}" th:value="${provider.pid}"
                            th:text="${provider.providerName}" th:selected="${provider.pid == pid}"></option>
                </select>
                <span>是否付款：</span>
                <select name="pay">
                    <option value="">--请选择--</option>
                    <option value="0" th:selected="${pay == 0}">未付款</option>
                    <option value="1" th:selected="${pay == 1}">已付款</option>
                </select>
                <input type="submit" value="查询" onclick="$('#searchForm').submit()"/>
            </form>
            <a th:href="@{/bill}" href="../bill/add.html">添加帐单</a>
        </div>
        <table class="providerTable">
            <tr class="firstTr">
                <th>账单编码</th>
                <th>商品名称</th>
                <th>供应商</th>
                <th>总金额</th>
                <th>是否付款</th>
                <th>创建时间</th>
                <th>操作</th>
            </tr>
            <tr th:each="bill:${bills}" class="provider_tr">
                <td th:text="${bill.billCode}"></td>
                <td th:text="${bill.billName}"></td>
                <td th:text="${bill.providerName}"></td>
                <td th:text="${bill.money}"></td>
                <td th:text="${bill.pay == 1 ? '已付款':'未付款'}"></td>
                <td th:text="${#dates.format(bill.createDate,'yyyy-MM-dd HH:mm:ss')}"></td>
                <td>
                    <a th:href="@{/bill/} + ${bill.bid}"><img th:src="@{/img/read.png}" src="../img/read.png" alt="查看"
                                                              title="查看"/></a> </a>
                    <a th:href="@{/bill/} + ${bill.bid} + '?type=update'"><img th:src="@{/img/xiugai.png}"
                                                                               src="../img/xiugai.png" alt=""></a>
                    <a th:attr="del_uri=@{/bill/delete/}+${bill.bid}" href="#" class="delete"><img th:src="@{/img/schu.png}"
                                                                                            src="../img/schu.png"
                                                                                            alt="删除"
                                                                                            title="删除"/></a>
                </td>
            </tr>
        </table>
    </div>
</section>
<!--点击删除按钮后弹出的页面-->
<div class="zhezhao"></div>
<form method="post" id="deleteForm">
    <input type="hidden" name="_method" value="delete">
    <div class="remove" id="removeProv">
        <div class="removerChid">
            <h2>提示</h2>
            <div class="removeMain">
                <p>你确定要删除吗？</p>
                <a href="#" id="yes">确定</a>
                <a href="#" id="no">取消</a>
            </div>
        </div>
    </div>
</form>
<footer th:replace="/public :: #public_footer"/>
</body>
</html>